using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Principal;

namespace Decav.Gatsb.Security
{
    /// <summary>
    /// The identity used in Gatsb to identify a user of the system.
    /// </summary>
    public class GatsbIdentity : IIdentity
    {
        public GatsbIdentity(Guid userId, string name)
        {
            if (name == null)
                throw new ArgumentNullException("name");
        
            _id = userId;
            _name = name;
        }

        #region IIdentity Members

        private string _name;
        private Guid _id;

        public string AuthenticationType
        {
            get
            {
                return "Gatsb";
            }
        }


        public bool IsAuthenticated
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// Gets the users friendly name (email address).
        /// </summary>
        public string Name
        {
            get
            {
                return _name;
            }
        }

        /// <summary>
        /// Gets the users unique identifier.
        /// </summary>
        public Guid UserId
        {
            get
            {
                return _id;
            }
        }

        #endregion
    }
}
